<?php

namespace app\model;

use think\facade\Db;
use think\Model;

class Users extends Model
{
    public function getUserInfoThree($field, $val)
    {
        $fields = ['qq_openid'];
        if(!in_array($field,$fields)){
            singleJson(false,'非法操作');
        }
        $info = Db::name('users')->field('id')->where(array($field => $val))->find();
        if($info){
            $info['token'] = createUserToken($info['id']);
        }
        singleJson($info, '获取用户信息出错');
    }
}